<template>
	<div class="upload-page">
		<div>Ajax模式发送文件</div>
		<div style="margin-top:10px">
			<form id="formFile" action="http://localhost:7001/problem/problem/uploadFile.htm" enctype="multipart/form-data" method="post" target="blank">
				<div style="margin-top:10px;"><input type="file" name="files"> </div>
				<div style="margin-top:10px;"><input type="file" name="files"> </div>
				<div style="margin-top:10px;"><input type="submit" value="上传" > </div>
			</form>
		</div>
		<div style="margin-top:10px;display:none">
			<button class="pure-button button-orange button-xsmall" @click="ajaxUpload">上传</button>
		</div>
    </div>
</template>
<script type="text/javascript">

	module.exports = {
		methods: {
			ajaxUpload: function() {
				var formData = new FormData($("#formFile")[0]);
				$.ajax({  
				    url: 'http://10.13.1.92:9208/problem/problem/uploadFile.htm' ,  
				    type: 'POST',  
				    data: formData,  
				    contentType: 'multipart/form-data', 
				    async: false,  
				    cache: false,  
				    processData: false

				}).done(function(res) {
					console.log(res);
				}).fail(function(res) {

				});
			}
		}
	}
</script>
<style type="text/css">
	.upload-page .button-list {
		margin:10px;
	}
	.upload-page .button-list button {
	}
	
</style>